package com.shuziren.vo;

import lombok.Data;

@Data
public class RegisterVo {
    private String username;
    private String password;
    private String email;


    // 校验方法
    public void validate() throws IllegalArgumentException {
        if (username == null || username.trim().isEmpty()) {
            throw new IllegalArgumentException("账号不能为空");
        }
        if (password == null || password.trim().isEmpty()) {
            throw new IllegalArgumentException("密码不能为空");
        }
        if (email == null || email.trim().isEmpty()) {
            throw new IllegalArgumentException("邮箱不能为空");
        }
    }
}